.class Lcom/estrongs/android/taskmanager/l;
.super Landroid/widget/BaseAdapter;


# instance fields
.field protected a:Ljava/util/HashMap;

.field protected b:Ljava/util/HashMap;

.field private c:Landroid/view/LayoutInflater;

.field private d:Ljava/util/List;

.field private e:Landroid/content/pm/PackageManager;

.field private f:Landroid/app/Activity;

.field private g:Lcom/estrongs/android/taskmanager/CacheManWrapper;


# direct methods
.method public constructor <init>(Landroid/app/Activity;Lcom/estrongs/android/taskmanager/CacheManWrapper;)V
    .locals 1

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/l;->e:Landroid/content/pm/PackageManager;

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/l;->a:Ljava/util/HashMap;

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/l;->b:Ljava/util/HashMap;

    iput-object p1, p0, Lcom/estrongs/android/taskmanager/l;->f:Landroid/app/Activity;

    iput-object p2, p0, Lcom/estrongs/android/taskmanager/l;->g:Lcom/estrongs/android/taskmanager/CacheManWrapper;

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->g:Lcom/estrongs/android/taskmanager/CacheManWrapper;

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/CacheManWrapper;->getApplicationList()Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/l;->d:Ljava/util/List;

    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/l;->c:Landroid/view/LayoutInflater;

    invoke-virtual {p1}, Landroid/app/Activity;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/l;->e:Landroid/content/pm/PackageManager;

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/taskmanager/l;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->d:Ljava/util/List;

    return-object v0
.end method

.method static synthetic b(Lcom/estrongs/android/taskmanager/l;)Lcom/estrongs/android/taskmanager/CacheManWrapper;
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->g:Lcom/estrongs/android/taskmanager/CacheManWrapper;

    return-object v0
.end method

.method static synthetic c(Lcom/estrongs/android/taskmanager/l;)Landroid/app/Activity;
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->f:Landroid/app/Activity;

    return-object v0
.end method


# virtual methods
.method public a(Ljava/util/HashMap;)V
    .locals 0

    iput-object p1, p0, Lcom/estrongs/android/taskmanager/l;->a:Ljava/util/HashMap;

    return-void
.end method

.method public getCount()I
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->d:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->d:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5

    if-nez p2, :cond_1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->c:Landroid/view/LayoutInflater;

    const v1, 0x7f03000e

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    new-instance v1, Lcom/estrongs/android/taskmanager/n;

    invoke-direct {v1}, Lcom/estrongs/android/taskmanager/n;-><init>()V

    const v0, 0x7f09006d

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/n;->b:Landroid/widget/ImageView;

    const v0, 0x7f09006e

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/n;->a:Landroid/widget/TextView;

    const v0, 0x7f090071

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/n;->c:Landroid/widget/TextView;

    const v0, 0x7f090070

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/n;->d:Landroid/widget/ImageView;

    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    :goto_0
    iget-object v0, p0, Lcom/estrongs/android/taskmanager/l;->d:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/ApplicationInfo;

    iget-object v2, v1, Lcom/estrongs/android/taskmanager/n;->b:Landroid/widget/ImageView;

    iget-object v3, p0, Lcom/estrongs/android/taskmanager/l;->e:Landroid/content/pm/PackageManager;

    invoke-virtual {v0, v3}, Landroid/content/pm/ApplicationInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    iget-object v2, v1, Lcom/estrongs/android/taskmanager/n;->a:Landroid/widget/TextView;

    iget-object v3, p0, Lcom/estrongs/android/taskmanager/l;->e:Landroid/content/pm/PackageManager;

    invoke-virtual {v0, v3}, Landroid/content/pm/ApplicationInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v3

    invoke-interface {v3}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget-object v2, v1, Lcom/estrongs/android/taskmanager/n;->d:Landroid/widget/ImageView;

    new-instance v3, Lcom/estrongs/android/taskmanager/m;

    invoke-direct {v3, p0, p1}, Lcom/estrongs/android/taskmanager/m;-><init>(Lcom/estrongs/android/taskmanager/l;I)V

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v2, p0, Lcom/estrongs/android/taskmanager/l;->a:Ljava/util/HashMap;

    iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    invoke-virtual {v2, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/PackageStats;

    if-eqz v0, :cond_0

    iget-object v1, v1, Lcom/estrongs/android/taskmanager/n;->c:Landroid/widget/TextView;

    iget-object v2, p0, Lcom/estrongs/android/taskmanager/l;->f:Landroid/app/Activity;

    iget-wide v3, v0, Landroid/content/pm/PackageStats;->cacheSize:J

    invoke-static {v2, v3, v4}, Landroid/text/format/Formatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    :cond_0
    return-object p2

    :cond_1
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/estrongs/android/taskmanager/n;

    move-object v1, v0

    goto :goto_0
.end method
